#include <iostream>
#include <string.h>
#include <b64/decode.h>
#include <b64/encode.h>

using namespace std;

int main(void)
{
    // base64编码
    base64::encoder E;
    char buf[32] = "hello world";
    char encode_buf[64] = "";
    int encode_buf_len = E.encode(buf, strlen(buf)+1, encode_buf);
    cout << "encode_buf_len: " << encode_buf_len << endl;
    cout << encode_buf << endl;

    // base64解码
    base64::decoder D;
    char decode_buf[32] = "";
    int decode_buf_len = 0;
    decode_buf_len = D.decode(encode_buf, encode_buf_len, decode_buf);
    cout << "deocde_buf: " << decode_buf_len << endl;
    cout << decode_buf << endl;

    return 0;
}